Public Class frmBangKeHoaDonMuaBan
    Dim msgError As String = ""
    Dim sqlQuery As String = ""

    Private Function checkInput() As Boolean
        msgError = ""
        checkInput = True
    End Function

    Private Sub btnInBaoCao_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInBaoCao.Click
        If checkInput() = True Then

            If Me.rbtnMuaVao.Checked = True Then
                Me.Cursor = Cursors.WaitCursor
                moduleUtils.tinhBangKeHoaDonMuaVao(CInt(Me.txtNam.Text.Trim), CInt(Me.txtThang.Text.Trim))
                Me.Cursor = Cursors.Default
                Dim myForm As New FrmCrBangKeHoaDonMuaVao
                myForm.setThang(Me.txtThang.Text.Trim)
                myForm.setNam(Me.txtNam.Text.Trim)
                myForm.Show()
            Else
                moduleUtils.tinhBangKeHoaDonBanRa(CInt(Me.txtNam.Text.Trim), CInt(Me.txtThang.Text.Trim))
                Dim myForm As New FrmCrBangKeHoaDonBanRa
                myForm.setThang(Me.txtThang.Text.Trim)
                myForm.setNam(Me.txtNam.Text.Trim)
                myForm.Show()
            End If

        End If
    End Sub

    Private Sub frmBangKeHoaDonMuaBan_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        moduleUtils.setDinhDangVietNam()
        Me.txtThang.Text = Format(Today.Month, "00")
        Me.txtNam.Text = Today.Year
    End Sub

    Private Sub btnThoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThoat.Click
        Me.Close()
    End Sub

    Private Sub BtnThue_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnThue.Click
        If checkInput() = True Then

            If Me.rbtnMuaVao.Checked = True Then
                Me.Cursor = Cursors.WaitCursor
                moduleUtils.tinhBangKeHoaDonMuaVao(CInt(Me.txtNam.Text.Trim), CInt(Me.txtThang.Text.Trim))
                Me.Cursor = Cursors.Default
                Dim myForm As New FrmCrBangKeHoaDonMuaVao_thue
                myForm.setThang(Me.txtThang.Text.Trim)
                myForm.setNam(Me.txtNam.Text.Trim)
                myForm.Show()
            Else
                moduleUtils.tinhBangKeHoaDonBanRa(CInt(Me.txtNam.Text.Trim), CInt(Me.txtThang.Text.Trim))
                Dim myForm As New FrmCrBangKeHoaDonBanRa_thue
                myForm.setThang(Me.txtThang.Text.Trim)
                myForm.setNam(Me.txtNam.Text.Trim)
                myForm.Show()
            End If

        End If

    End Sub
End Class